<template lang="html">	
	<div class="">
		<button class="btn btn-success" @click="change(1)">组件一</button>
		<button class="btn btn-success" @click="change(2)">组件二</button>
		<hr>
		<!-- <child1></child1>
		<child2></child2> -->
		<div class="" :is="currentCom"></div>
	</div>
</template>
<script>
import child1 from '@/page/com/isChild1'
import child2 from '@/page/com/isChild2'
export default{
	data(){
		return{
			currentCom:'child1'
		}
	},
	components:{
		child1,
		child2
	},
	methods:{
		change(index){
			if(index==1){
				this.currentCom='child1'
			}
			else{
				this.currentCom='child2'
			}
		}
	}
}
</script>
<style scoped="">
	
</style>